import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import vitePluginSettingCssModule from 'vite-plugin-setting-css-module';
import config from './config.default'
export default defineConfig({
  base: './',
  plugins: [react(),
  vitePluginSettingCssModule({
    exclude: /App.css/
  }) as any,
  ],

  server: {
    port: config.listen.port,
    host: config.listen.host,
  },
  resolve: {
    alias: {
      '@': path.join(__dirname, "src"),
    },
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true
      },

    }
  },
  build: {
    rollupOptions: {
      external: []
    },
    commonjsOptions: {
      transformMixedEsModules: true
    }
  },
  define: {
    'process.env': {
      'CUSTOM_NODE_ENV': 'development'
    },
  },
})
